package com.swust.dumpling.commons.z;

import java.util.Map;

import com.swust.dumpling.commons.utils.RSAUtil;

public class TestRSA {
	
	public static final int puq = 37;
	public static final int pup = 41;
	public static final int puk = 7;
	
	public static void main(String[] args) throws Exception {
		RSAUtil rsa = RSAUtil.getRSAUtil(puq, pup, puk);
		Map<String , Integer> map = rsa.getRSAkey();
		System.out.println("public:\t\t"+map.get("puk"));
		System.out.println("private:\t"+map.get("prk"));
		System.out.println("num:\t\t"+map.get("num"));
		
		int message = rsa.encodeByRSA(1000);
		
		System.out.println("encode message \t"+message);
		System.out.println("decode message \t"+RSAUtil.decode(message, map.get("prk"), map.get("num")));
	}
}
